<template>
  <div id="split">  
       <div  style="display:flex;margin-bottom:10px;align-items: center;">
            <img class="top_img" src="@/assets/images/a8.png" style="width:35px;height:35px;margin-right:10px;"/>
            <div style="line-height: 40px;font-weight:bold:">拆分记录</div>
     </div> 
       <el-form ref="form" :model="form" label-width="80px">  
     <el-row> 
          <el-col :span="18" style="display:flex;">

           <el-form-item label-width="0px" style="margin-left:10px;">
            <el-input v-model="form.bh" placeholder="果种编号"></el-input>
          </el-form-item>

          <el-form-item label-width="0px" style="margin-left:10px;">
            <el-input v-model="form.phone" placeholder="姓名/手机号"></el-input>
          </el-form-item>

           <div class="custom_button2"  style="margin-left:10px;" @click="search_but()"></div>
        </el-col>
         <el-col :span="6" style="text-align: right;"> 
              <el-button type="primary" class="custom_color_button1" style="margin-bottom:10px;" @click="time_but()">显示时间</el-button>         
        </el-col> 
       
    </el-row>
      </el-form>
   <!-- 渲染数据list -->
   <split-list :datalist="datalist" @up_list_fun="list_fun"> </split-list>

      <div style="margin-top:20px;text-align: center;">
                <el-pagination
                    background
                    @current-change="handleCurrentChange"
                    :page-size="10"  
                    layout="prev, pager, next, jumper"
                    :total="count">
                </el-pagination>
           </div>

      
  </div>
</template>

<script>
import SplitList from '@/view/Exchangeorder/SplitList'
export default {
  name: 'split',
  data () {
    return {
        datalist:[],
        page:1,
        count:0,
        form:{
           bh:'',
           phone:''
        }
    }
  },
 components:{
    SplitList
  },
  created(){
     this.list_fun()
  },
  mounted (){
    
  },
  methods: {
     list_fun(){
          this.post("/split_log/listOfEntire", {
              account:this.form.phone,
              new_pid:this.form.bh,
               page:this.page
	        }).then(res => {
            this.count = res.result.count
            this.datalist = res.result.list
            console.log(res)
         })
      },
      search_but(){
           this.page = 1
           this.list_fun()
      },
      time_but(){
         this.$router.push({
          path: '/index/looktime',
          query: {
            name:'显示时间',
          }
        })
      },
      handleSizeChange(val) {
        console.log(`每页 ${val} 条`);
      },
      handleCurrentChange(val) {
        this.page = val
        this.list_fun()
        console.log(`当前页: ${val}`);
      }
     

  }
}
</script>


<style scoped>

</style>
